#ifndef REGIST_H
#define REGIST_H

#include <QDialog>
#include <QString>
#include <QFile>
#include <QByteArray>
#include <QStringList>
#include <QList>
#include <QMessageBox>
#include <QTextStream>
#include <QIODevice>
#include <QIcon>
#include "config.h"
#include "user.h"

namespace Ui {
class Regist;
}

class Regist : public QDialog
{
    Q_OBJECT

public:
    explicit Regist(QList<User *> users, QWidget *parent = 0);
    ~Regist();
    void getAllUsers(); //获取所有用户
    void initScene(); //初始化窗口
    bool isPwdSame(); //判断两次输入的密码是否一致

    bool isPostExist(QString post); //判断端口是否存在

    QList<User *> users;
    User * regiUser; //新注册用户
    QVector<QString> postVec; //存储已有的端口
signals:
    void sendRegistUser(User *);
    void showMe();
public slots:
    void showRegist(); //显示当前窗口
private slots:
    void on_regist_clicked();

    void on_back_clicked();

private:
    Ui::Regist *ui;
};

#endif // REGIST_H
